feat(session-replay): upload replay envelope from the native crash daemon#1809
Conversation
|
154ce2f to
b437853
Compare
jpnurmi
left a comment
There was a problem hiding this comment.
Very cool to see session replays becoming properly integrated! 🎉
jpnurmi
left a comment
There was a problem hiding this comment.
LGTM 👍
Even if this feature is currently only used and tested by sentry-unreal, it wouldn't hurt to have something in test_integration_native.py to verify that a correctly structured replay envelope is sent when a dummy replays/foo.mp4 exists.
Not sure if you saw the discussion about the overhead of the continuously flushed __sentry-event file yesterday and how it will likely be replaced by IPC messaging in the future. Such a change would also impact the replay envelope, so it'd be nice to prevent potential regressions early. 🙏
|
Added a minimal set of tests in b1ab19c. Maybe creating a dummy mp4 will work to test this end-to-end in Unreal too 🤔 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6cabda1. Configure here.

This PR adds Session Replay product support to the
nativebackend. When a downstream SDK (e.g. sentry-unreal) has staged a recorded clip on disk, the crash daemon now builds areplay_videoenvelope from it and performs an upload so the clip becomes a first-class Session Replay in Sentry, linked to the crash instead of only being available as a file attachment.Key Changes
sentry__session_replay_flush_pending(): scans<database>/replays/for embedder-staged clips (areplay-<id>.jsonmetadata sidecar + its.mp4), builds thereplay_event+replay_recording+ video into areplay_videoenvelope, and hands it to the transport.trace_id, read back from<run>/__sentry-event. This makes the replay carry the same tags as the crash and correlate via the same trace.flush_pendingout-of-process, so the replay is sent in the same session as the crash (no next-launch step).replays/convention.replay_videoenvelope items are now classified under a dedicatedreplaydata category instead of falling back toerror. This stops error rate limits from dropping replays, honors a server-sidereplayrate limit, and reports discarded replays under the correct category.Known Limitations
crashpad/breakpad/inproc.Related items
#skip-changelog